package com.itheima.service;

import com.itheima.domain.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

//value用于指定调用nacos下哪个微服务
@FeignClient(value = "service-product")
public interface ProductService {

    //@FeignClient的value值 和 @RequestMapping的value值
    //其实就是完整的请求地址："http://:serviceInstance.getPort()/product/" + pid
    //指定请求的uri部分
    @RequestMapping("/product/{pid}")
    public Product findByPid(@PathVariable Integer pid);
}
